package com.example.spring.exercise.service.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : zhayh
 * @date : 2021-3-13 16:12
 * @description : 学生对象
 */
@ApiModel("学生信息对象")
@Data
@Builder
public class StudentDTO {
    @ApiModelProperty("学号")
    private String studentCode;
    @ApiModelProperty("姓名")
    private String studentName;
    @ApiModelProperty("班级")
    private BaseClassInfo classInfo;
    @ApiModelProperty("舍友")
    private List<StudentDTO> roommates;

    public static List<StudentDTO> students=new ArrayList<>();
    public static void initStudents(){
        BaseClassInfo classInfo = BaseClassInfo.builder()
                .classCode("1902783")
                .className("移动1923")
                .classYear(2019)
                .build();
        for(int i=0;i<10;i++){
            StudentDTO studentDTO=StudentDTO.builder()
                    .classInfo(classInfo)
                    .studentCode("student"+(i+1))
                    .studentName("学生"+(i+1))
                    .build();

            students.add(studentDTO);
        }
    }
}
